package net.towee.client.event.core;

import net.towee.model.account.AccountIdentity;

import com.google.gwt.event.shared.GwtEvent;

public class UserAddedToContactsEvent extends GwtEvent<UserAddedToContactsHandler> {
	public static Type<UserAddedToContactsHandler> TYPE = new Type<UserAddedToContactsHandler>();
	private final AccountIdentity identity;
	private final String groupName;

	public UserAddedToContactsEvent(AccountIdentity whoAdd, String groupName){
		this.identity = whoAdd;
		this.groupName = groupName;
	}
	
	@Override
	public Type<UserAddedToContactsHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(UserAddedToContactsHandler handler) {
		handler.userAddedToContacts(identity, groupName);
	}

}
